//package cn.wolfcode.wolf2w.business.mapper;
//
//import cn.wolfcode.wolf2w.business.api.domain.QuestionCollection;
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
//import org.apache.ibatis.annotations.*;
//import org.springframework.data.domain.Page;
//
///**
// * 问题收藏Mapper接口
// */
//@Mapper
//public interface QuestionCollectionMapper extends BaseMapper<QuestionCollection> {
//
//    /**
//     * 查询用户收藏的问题列表（带问题信息）
//     */
//    @Select("SELECT " +
//            "c.*, " +
//            "q.id as q_id, " +
//            "q.title as q_title, " +
//            "q.content as q_content, " +
//            "q.view_num as q_view_num, " +
//            "q.answer_num as q_answer_num, " +
//            "q.collect_num as q_collect_num " +
//            "FROM ta_question_collection c " +
//            "LEFT JOIN ta_question q ON c.question_id = q.id " +
//            "WHERE c.user_id = #{userId} " +
//            "ORDER BY c.create_time DESC")
//    @Results({
//            @Result(id = true, column = "id", property = "id"),
//            @Result(column = "question_id", property = "questionId"),
//            @Result(column = "user_id", property = "userId"),
//            @Result(column = "create_time", property = "createTime"),
//            @Result(property = "question", column = "q_id", one = @One(select = "cn.wolfcode.wolf2w.mapper.QuestionMapper.selectById"))
//    })
//    Page<QuestionCollection> selectCollectionWithQuestion(Page<QuestionCollection> page, @Param("userId") Long userId);
//
//    /**
//     * 查询问题的收藏用户列表（带用户信息）
//     */
//    @Select("SELECT " +
//            "c.*, " +
//            "u.id as u_id, " +
//            "u.nickname as u_nickname, " +
//            "u.avatar as u_avatar " +
//            "FROM ta_question_collection c " +
//            "LEFT JOIN ta_user u ON c.user_id = u.id " +
//            "WHERE c.question_id = #{questionId} " +
//            "ORDER BY c.create_time DESC")
//    @Results({
//            @Result(id = true, column = "id", property = "id"),
//            @Result(column = "question_id", property = "questionId"),
//            @Result(column = "user_id", property = "userId"),
//            @Result(column = "create_time", property = "createTime"),
//            @Result(property = "user", column = "u_id", one = @One(select = "cn.wolfcode.wolf2w.mapper.UserMapper.selectById"))
//    })
//    Page<QuestionCollection> selectCollectionWithUser(Page<QuestionCollection> page, @Param("questionId") Long questionId);
//}